package com.taotao.portal.service;


import org.springframework.stereotype.Service;

import com.taotao.rest.webservice.IOException_Exception;
import com.taotao.rest.webservice.SearchResult;
import com.taotao.rest.webservice.SearchWebService;
import com.taotao.rest.webservice.SearchWebService_Service;
import com.taotao.rest.webservice.SolrServerException_Exception;

@Service
public class SearchServiceImpl implements SearchService {

	@Override
	public SearchResult getItemList(String queryString, int page, int rows) {
		// TODO Auto-generated method stub
		
		SearchWebService_Service factory = new SearchWebService_Service();
		SearchWebService searchWebService = factory.getSearchWebServiceImplPort();
		SearchResult result = null;
		try {
			result = searchWebService.search(queryString, page, rows);
		} catch (IOException_Exception | SolrServerException_Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//SearchResult itemList = JsonUtils.jsonToPojo(result, SearchResult.class);
		return result;
	}

}
